package algorithm.dynamicprogramming;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class In {
    private String filename;

    public In(String filename) {
        this.filename = filename;
    }

    public String readAll() {
        try {
            BufferedReader br = new BufferedReader(new FileReader(filename));
            String text = "";
            String line;
            while ((line = br.readLine()) != null) {
                text += line;
            }
            return text;
        } catch (FileNotFoundException e) {
            System.err.println(filename + " is not found!");
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return "";
    }
}
